package com.ruoyi.project.oms.paeaAuAuditItem.enums;

import java.util.HashMap;
import java.util.Map;

public enum AuditItemState{

	UN_AUDIT(1, "未监控","blue"),
	NORMAL_PASS(2, "正常","green"),
	HAVE_ERROR(3, "督办","red");


	private static Map<Integer, AuditItemState> codeMap;
	private static Map<String, AuditItemState> nameMap;
	static{
		codeMap = new HashMap<Integer, AuditItemState>();
		nameMap = new HashMap<String, AuditItemState>();
		for(AuditItemState state:AuditItemState.values()){
			codeMap.put(state.getCode(), state);
			nameMap.put(state.getName(), state);
		}
	}
	public static AuditItemState getAuditItemStateByName(String name){
		return nameMap.get(name);
	}
	public static AuditItemState getAuditItemStateByCode(int code){
		return codeMap.get(new Integer(code));
	}


	private int code;
	private String name;
	private String color;
	private AuditItemState(int code, String name,String color) {
		this.code = code;
		this.name = name;
		this.color = color;
	}
	public String getColor() {
		return color;
	}
	public int getCode() {
		return code;
	}
	public String getName() {
		return name;
	}
}
